module.exports = {
    // 点击往播放列表添加歌曲
    ClickAddInsertSong(state, song) {
        state.songList.splice(state.index, 0, song)
    },
    // 改变用户登录状态 
    getUserState(state, userState) {
        state.userState = userState
    },
    // 登录获取用户数据
    getUserInfo(state, user) {
        state.userInfo = user
    },
    // 获取歌曲列表
    getSongList(state, list) {
        state.songList = list
    },
    // 获取歌曲播放下标
    getIndex(state, index) {
        state.index = index
    },
    // 播放状态
    getPlayState(state, player) {
        state.player = player
    },
    // 点击修改颜色
    handleEditColor(state) {
        state.songList.forEach(item => {
            item.color = ""
        })
    },
    // 当前选中时的颜色
    handleSelectColor(state, color) {
        state.songList[state.index].color = color
    }
}